<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="../../../static/css/index.css">
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <title>添加线路</title>
</head>
    <body>
    <div>
        <div th:include="admin/navigation :: nav"></div>
    </div>
    <div class="col-lg-4 col-md-4 col-xs-4" >
        <div th:each="station : ${session.stations}">
            <p th:text="${station.getId()} + ${station.getStationName()}"></p>
        </div>
    </div>
    <div class="col-lg-4 col-md-4 col-xs-4">
        <h1>添加线路</h1>
        <form action="/admin/addRoute" method="post">
            <div class="form-group">
                <label for="startStation">起始站</label>
                <select class="form-control" id="startStation" name="startStation">
                    <option th:each="station : ${session.stations}" th:text="${station.getStationName()}" th:value="${station.getId()}"></option>
                </select>
            </div>
            <div class="form-group">
                <label for="endStation">终点站</label>
                <select class="form-control" id="endStation" name="endStation">
                    <option th:each="station : ${session.stations}" th:text="${station.getStationName()}" th:value="${station.getId()}"></option>
                </select>
            </div>
            <div class="form-group">
                <label for="routeCode">具体路径</label>
                <input type="text" name="routeCode" class="form-control" id="routeCode" placeholder="输入站点名称">
            </div>
            <button type="submit" class="btn btn-primary">添加</button>
        </form>
    </div>
    <div class="col-lg-4 col-md-4 col-xs-4">
        <h3>Tips</h3>
        1. 具体路径直接使用每个站点的id来表示(使用-连接)，比如北京站点id为1，上海站点id为2，广州id为3，那么北京 --> 上海 --> 广州的具体路径就是1-2-3<br>
        2. 每添加一条站点数超过2的站点，系统会自动添加其中的所有的连续子站点及其逆序，比如添加一条路径为1-2-3，那么1-2，2-3，2-1，3-2，3-2-1也会被添加。<br>
    </div>
    </body>
    </body>
</html>